const webpack = require('webpack')
const path = require('path')
module.exports = {
	configureWebpack: {
		plugins: [new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)],
		resolve: {
			extensions: ['.js', '.json', '.vue'],
			alias: {
				'@': path.resolve(__dirname, './src'),
				'@v': path.resolve(__dirname, './src/views'),
				'@c': path.resolve(__dirname, './src/components'),
				'@ant-design/icons/lib/dist$': path.resolve(
					__dirname,
					'./src/plugins/icons.js'
				),
			},
		},
	},
	css: {
		sourceMap: false,
		modules: false,
		loaderOptions: {
			less: {
				javascriptEnabled: true,
			},
			sass: {
				prependData: `@import "./src/assets/css/main.scss";`,
			},
		},
		requireModuleExtension: true,
	},
	devServer: {
		open: false, // 编译完成是否打开网页
		host: '0.0.0.0', // 指定使用地址，默认localhost,0.0.0.0代表可以被外界访问
		port: 8080, // 访问端口
		https: false, // 编译失败时刷新页面
		hot: true, // 开启热加载
		hotOnly: false,
	},
}
